package com.tplan.util;

import com.google.gson.Gson;
import com.tplan.domain.Email;

public class GsonUtil {

    private static Gson gson = new Gson();

    public static String ObjectToGson(Object object) {

        return gson.toJson(object);

    }


    public static void main(String[] args) {
        Email email = new Email();
        email.setContent("test hello");
        email.setTitle("test title");
        email.setTarget("test target");
        email.setContentType("test contenttype");
        System.out.println(ObjectToGson(email));
    }
}
